﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Zosnn.IBLL;
using Zosnn.IDAL;

namespace Zosnn.BLL
{
    public abstract class BaseService<T> : IServiceBase<T> where T : class
    {
        protected IRepositoryBase<T> CurrentRepository { get; set; }

        public BaseService(IRepositoryBase<T> currentRepository) { CurrentRepository = currentRepository; }

        public T Add(T entity) { return CurrentRepository.Add(entity); }

        public bool Update(T entity) { return CurrentRepository.Update(entity); }

        public bool Delete(T entity) { return CurrentRepository.Delete(entity); }
    }
}